#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
  pid_t id = fork();
  if(id == 0)
  {
    chdir("/home/hx");
    while(1)
    {
      printf("我是子进程,id:%d\n",getpid());
      sleep(1);
    }
  }
  waitpid(id,NULL,0);
  return 0;
}
